package Week4.J0510;

import java.util.Arrays;
import java.util.Scanner;

public class 字符串的分类 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        String[] type = new String[n];
        int i = 0;

        while (n-- != 0) {
            char[] s = scanner.next().toCharArray();
            boolean flag = false;
            Arrays.sort(s);
            String str = Arrays.toString(s);

            for (int j = 0; j <= i; j++) {
                if (str.equals(type[j])) {
                    flag = true;
                    break;
                }
            }
            if (!flag) {
                type[i+1] = str;
                i++;
            }
        }
        System.out.println(i);
    }
}
